package org.ricks.log.message;

/**
 * @author chenwei
 * @Description:
 * @date 2023/1/916:10
 */
abstract class AbstractMessage implements Message{

    protected final String msg;

    AbstractMessage(String msg) {
        this.msg = msg;
    }

    @Override
    public void build(StringBuilder toAppendTo) {
        this.onBuildMessage(toAppendTo);
    }

    /**
     * 构建日志内容
     *
     * @param sb StringBuilder对象.
     */
    protected abstract void onBuildMessage(StringBuilder sb);
}
